#!/bin/sh

# lsvpd/lscfg/lsmcode - List VPD, system configuration, microcode versions.

# This file is part of the Linux lsvpd package.

# (C) Copyright IBM Corp. 2002, 2003, 2004, 2005

# Maintained by Martin Schwenke <martins@au.ibm.com>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    
# $Id: lsvpd.in,v 1.1 2006/04/11 18:38:28 emunson Exp $

if [ -z "$LSVPD_LIBDIR" ] ; then
    LSVPD_LIBDIR="/lib/lsvpd" ; export LSVPD_LIBDIR
fi

PATH="${LSVPD_LIBDIR}:/sbin:${PATH}:/usr/sbin:/usr/local/sbin" ; export PATH

. "${LSVPD_LIBDIR}/lsvpd-functions.bash"

shopt -s nullglob

######################################################################

# The next line can go away if options are made consistent.
case "${0##*/}" in
    (lsmcode|lsvio) db_path_option="D" ;;
esac
process_db_path_options "$@"

[ -n "$tgz" ] && unpack_device_tree_archive "$tgz"

do_setup query "${0##*/}"  # basename
process_options "$@"
. "${LSVPD_LIBDIR}/debug.bash"
ensure_db

run_dynamic_vpd_hooks

print_global_header

list_linux_vpd |
render_all
